@/*
    选择查询条件标签的参数说明:

    name : 查询条件的名称
    id : 查询内容的input框id
@*/
<div class="input-group selectcon">
    <div class="input-group-btn">
        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">
            ${name}
        </button>
    </div>
    <select class="form-control" id="${id}" name="${id}" style="width: 100%;"
            @if(isNotEmpty(multiple)){
                multiple="multiple"
            @}
         >
            ${tagBody!}
            @if(isNotEmpty(dictPCode)){
                @for(dict in constant.listDictsByPCode(dictPCode)){
                    @if(isNotEmpty(value) && (dict.value == value+""||dict.name==value)){
                        <option value="${dict.value}" selected="selected">${dict.name}</option>
                    @}else{
                        <option value="${dict.value}">${dict.name}</option>
                    @}
                @}
            @}
        </select>
    </div>

@if(isNotEmpty(select2Flag)){
<script>
    $("#${id}").select2({
        language: "zh-CN"
       	,placeholder: ''
        @if(isNotEmpty(multiple)){
            ,multiple:true
        @}
        @if(isNotEmpty(urlForSelect2)){
            ,ajax: {
                type:"post",
                    async:false,
                    delay:1000,
                    url: "${urlForSelect2}",
                    data: function (params) {
                        @if(isNotEmpty(paramFun)){
                            var param = ${paramFun};
                        @}else{
                            var param = {};
                        @}
                        param.term=params.term;
                        param.limit=${isNotEmpty(limit)?limit:10};
                        param.offset=params.page != null ? ((params.page - 1) * ${isNotEmpty(limit)?limit:10}) : 0;
                        return param;
                    }
                }
        @}
    });
</script>
@}
